<?php
class Item extends AppModel {

	var $name = 'Item';
	var $useDbConfig = 'dspace';
	var $useTable = "item";
	var $primaryKey = 'item_id';

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $hasMany = array(
			// データ量の多いテーブルなのでリソースが豊富でなければ重い可能性あり
			// 不必要な dc_type_id のレコードはこの段階で取得しないようにする
			'Dcvalue' => array('className' => 'Dcvalue',
								'foreignKey' => 'item_id',
								'dependent' => false,
								'conditions' => array(
									'dc_type_id' => array(
										// 3,19,25,26,30,   44,49,50,75,   81,   95,96,97,98,99, // CSVのみ
										// 3,19,   26,30,31,44,   50,75,78,81,94,95,96,97,98,99, // BibTeXのみ
										   3,19,25,26,30,31,44,49,50,75,78,81,94,95,96,97,98,99, // CSV + BibTeX
									),
								),
								'fields' => '',
								'order' => array('dc_value_id' => 'ASC'),
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			),
			'Itemsbyauthor' => array('className' => 'Itemsbyauthor',
								'foreignKey' => 'item_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => array('items_by_author_id' => 'ASC'),
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			),
			'Collectionitemsbyauthor' => array('className' => 'Collectionitemsbyauthor',
								'foreignKey' => 'item_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => array('items_by_author_id' => 'ASC'),
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			),
			/*
			'Collectionitemsbytitle' => array('className' => 'Collectionitemsbytitle',
								'foreignKey' => 'item_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => array('items_by_title_id' => 'ASC'),
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			),
			*/
	);

	var $hasOne = array(
			'Itemsbydate' => array('className' => 'Itemsbydate',
								'foreignKey' => 'item_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => '',
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			),
			'Itemsbytitle' => array('className' => 'Itemsbytitle',
								'foreignKey' => 'item_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => '',
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			),
	);

}
?>